package com.contiguous.pair.analyser.filereader;

import java.util.ArrayList;
import java.util.List;

public class ContiguousPairList
{
	private List<CharPair>	charPairList;

	public ContiguousPairList()
	{
		this(new ArrayList<CharPair>());
	}

	public ContiguousPairList(List<CharPair> charPairList)
	{
		this.charPairList = charPairList;
	}

	public ContiguousPairList(String createFrom)
	{
		this(new ArrayList<CharPair>());
		for (int i = 0; i < createFrom.length() - 1; i++)
		{
			charPairList.add(new CharPair(createFrom.charAt(i), createFrom.charAt(i + 1)));
		}
	}

	public ContiguousPairList createFilteredCopy(ContiguousPairListFilter filter)
	{
		ArrayList<CharPair> copiedList = new ArrayList<CharPair>();
		copiedList.addAll(charPairList);
		ContiguousPairList copy = new ContiguousPairList(copiedList);
		copy.filter(filter);
		return copy;
	}

	private void filter(ContiguousPairListFilter filter)
	{
		// TODO Auto-generated method stub

	}

	public List<CharPair> getCharPairList()
	{
		return charPairList;
	}

	public void setCharPairList(List<CharPair> charPairList)
	{
		this.charPairList = charPairList;
	}
}